package
{
  	import com.pblabs.engine.PBE;

  	import com.pblabs.engine.entity.IEntity;
  	import com.pblabs.engine.entity.allocateEntity;
  	import com.pblabs.rendering2D.SimpleShapeRenderer;
  	import com.pblabs.rendering2D.ui.SceneView;

  	import flash.geom.Point;

  	// Set the initial size of the application, and define the
  	// maximum frame rate
  	[SWF(width="640", height="480", frameRate="60")]
  	public class HelloWorld extends SceneView
  	{
        	public function HelloWorld()
        	{
              	// Start the PushButton Engine
              	PBE.startup(this);
              	// Initialize some default PushButton components
              	PBE.initializeScene(this);

              	// Create a component to draw a shape on the screen
              	var shapeRenderer:SimpleShapeRenderer =
                    	new SimpleShapeRenderer();
              	// Set the reference to the scene
              		shapeRenderer.scene = PBE.scene;
              	// Set the position of the shape drawn on the screen
              	shapeRenderer.position = new Point(
                    		stage.stageWidth / 2,
                    		stage.stageHeight / 2);

              	// Create an entity to hold the component
              	var entity:IEntity = allocateEntity();
              	// Initialize the Entity with the supplied name
              	entity.initialize("TestEntity");
              	// Add the component to the Entity
              	entity.addComponent(shapeRenderer, "Render");
        	}
  	}
}